﻿using System.Configuration;

namespace ERP.Framework.Components.ConfigurationHelper.CustomSettings
{
    /// <summary>
    /// Represent SortingSettings section in config file
    /// </summary>
    public sealed class SortingSettings : ConfigurationSection
    {
        #region Properties

        /// <summary>
        /// Gets the settings.
        /// </summary>
        /// <value>The settings.</value>
        internal static SortingSettings Settings
        {
            get
            {
                return System.Configuration.ConfigurationManager.GetSection("SortingSettings") as SortingSettings;
            }
        }

        /// <summary>
        /// Gets the sorting algorithm.
        /// </summary>
        /// <value>The sorting algorithm.</value>
        [ConfigurationProperty("SortingAlgorithm", DefaultValue = "0", IsRequired = true)]
        public int SortingAlgorithm
        {
            get
            {
                return int.Parse(this["SortingAlgorithm"].ToString());
            }
        }

        #endregion
    }
}
